class ShelfShell:
    def run(self):
        print('shelf 0.1 on Win32')
        while self._running:
            print('Shelf > ', end='')
            in_cmd = input()
            if in_cmd == 'exit':
                self._exit()
                continue

            if in_cmd == 'usage':
                self._usage()
                continue

            if in_cmd == 'list':
                self._list()
                continue

            if in_cmd == 'view':
                self._view()
                continue

            if in_cmd == 'add':
                self._add()
                continue

            print('Unkown command [%s], use command \'usage\' may help' % (in_cmd))

    def _view(self):
        pass

    def _add(self):
        pass

    def _list(self):
        pass

    def _exit(self):
        self._running = False
        print('Bye')

    def _usage(self):
        print('==== all valid commands ====')
        print('\tusage: show this usage')
        print('\texit: exit shelf')
        print('\tlist: list...')
        print('\tview: view record with id')
        print('\tadd: create new record')

    _running = True
